package com.menghao.sso.client.filter;

import com.menghao.sso.client.http.SsoRequestWrapper;
import com.menghao.sso.client.model.ClientUser;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * <p>包装过滤器，用于getRemoteUser、getAuthType.<br>
 *
 * @author menghao.
 * @version 2017/11/15.
 */
public class WrapInfoFilter extends AbstractCasFilter {

    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
            throws IOException, ServletException {
        // 封装用户信息 (do nothing)
        filterChain.doFilter(new SsoRequestWrapper(request, new ClientUser()), response);
    }
}
